package net.zui.comp;

import java.awt.Color;
import java.awt.Graphics2D;

import net.zui.entity.ZTextRender;
import net.zui.inter.IGroup;

public class ZButton extends ZRect{
	protected ZTextRender ztext=new ZTextRender("");
	
	public ZButton(IGroup frame, int width, int height,String text) {
		super(frame, width, height,Color.WHITE);
		ztext.setText(text);
	}
	
	public ZButton(String id, IGroup frame, int x, int y, int width, int height, int index,String text) {
		super(id, frame, x, y, width, height, index,Color.WHITE);
		ztext.setText(text);
	}
	
	public ZButton(String id, IGroup frame, int x, int y, int width, int height,String text) {
		super(id, frame, x, y, width, height,Color.WHITE);
		ztext.setText(text);
	}
	
	@Override
	protected void draw(Graphics2D g) {
		super.draw(g);
		if(ztext!=null)ztext.draw(g, this);
	}
	
	public ZTextRender getText() {
		return ztext;
	}
	
	public void setText(ZTextRender ztext) {
		this.ztext=ztext;
	}
	
	public void setText(String text) {
		ztext.setText(text);
	}
}
